-module(bmula).
-include("bmula.inc").
-compile(export_all).

start() ->
    inet_db:add_ns({192,168,1,1}),
    application:start(bmula).

stop() ->
    application:stop(bmula).

%% bmula_stats
increment_stat(NS, Key, Value) -> bmula_stats:increment(NS, Key, Value).
get_stats(NS) -> bmula_stats:stats(NS).
get_marks() -> bmula_stats:marks().

%% bmula_random
uniform() -> bmula_random:uniform().
uniform(Max) -> bmula_random:uniform(Max).
uniform(Min, Max) -> bmula_random:uniform(Min, Max).
word() -> bmula_random:word().
word(Kind) -> bmula_random:word(Kind).
dict(Kind, Words) -> bmula_random:dict(Kind, Words).
password() -> bmula_random:password().
uint8() -> uniform(256) - 1.
sint8() -> uniform(256) - 128.
uint16() -> uniform(65536) - 1.
sint16() -> uniform(65536) - 37268.
uint32() -> uniform(4294967296) - 1.
sint32() -> uniform(4294967296) - 2147483648.
ufloat32() -> uniform().
sfloat32() -> (uniform() * 2.0) - 1.0.

%% bmula_smtpc
email(To, Subject, Message) ->
	bmula_smtpc:deliver(To, Subject, Message, false).
email_wait(To, Subject, Message) ->
	bmula_smtpc:deliver(To, Subject, Message, true).

